package org.example.controller;

import org.example.vo.ResultVo;
import org.example.service.FileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
public class FileController {
    @Autowired
    private FileService fileService;

    @PostMapping("/store-file")
    public ResultVo<String> storeFile(@RequestParam("file") MultipartFile file) {
        String string = fileService.storeFile(file);
        return new ResultVo<String>().success(string);
    }
}
